<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="pragram" content="no-cache"/>
    <meta http-equiv="cache-control" content="no-cache, must-revalidate"/>
    <meta http-equiv="expires" content="0"/>
    <meta name="renderer" content="webkit"/>
    <meta name="viewport" content="width=device-width,initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no"/>
    <title>客户资料</title>

    <link rel="stylesheet" href="/assets/css/lib/pagination.css">
    <link rel="stylesheet" href="/assets/css/lib/bootstrap.min.css">
    <link rel="stylesheet" href="/assets/css/common.css">
    <link rel="stylesheet" href="/assets/css/client_detail.css">

</head>
<body>
<div  id="cms">
    <jsp:include page="title_bar.jsp"/>
    <jsp:include page="tab_bar.jsp"/>
    <div class="cms-content">
        <div class="current-place">
            <div class="place-title">当前位置:</div>
            <div class="place-val">首页/客户管理/客户资料</div>
        </div>
        <div class="cms-sub-content clearfix">
            <div class="cms-sub-left">
                <div class="table-util">
                    <div class="common-title">
                        <div class="common-left-line"></div>
                        <div class="common-text">客户基本情况</div>
                    </div>
                    <div class="table-box">
                        <table class="table table-bordered">
                            <tr>
                                <th>客户姓名</th>
                                <th>手机号</th>
                                <th>手机号归属地</th>
                                <th>账号创建时间</th>
                                <th>账户状态</th>
                                <th>客户ID</th>
                            </tr>
                            <tr>
                                <td>${userBaseInfo.uname}</td>
                                <td>${userBaseInfo.uphone}</td>
                                <td>${userBaseInfo.uphoneArea}</td>
                                <td>${userBaseInfo.createTime}</td>
                                <td id="ustates">${userBaseInfo.ustates}</td>
                                <td>${userBaseInfo.wxopenid}</td>
                            </tr>
                        </table>
                    </div>
                </div>
                <div class="table-util">
                    <div class="common-title">
                        <div class="common-left-line"></div>
                        <div class="common-text">客户渠道来源</div>
                    </div>
                    <div class="table-box">
                        <table class="table table-bordered">
                            <tr>
                                <th>顶级渠道代码</th>
                                <th>顶级渠道名称</th>
                                <th>一级渠道代码</th>
                                <th>二级渠道代码</th>
                                <th>三级渠道代码</th>
                            </tr>
                            <tr>
                                <td>${cannelInfo.spcode}</td>
                                <td>${cannelInfo.spcode}</td>
                                <td>${cannelInfo.spcode}</td>
                                <td>${cannelInfo.spcode}</td>
                                <td>-</td>
                            </tr>
                        </table>
                    </div>
                </div>
                <div class="table-util">
                    <div class="common-title">
                        <div class="common-left-line"></div>
                        <div class="common-text">客户咨询情况</div>
                        <div class="call-record-btn common-right-btn"  onclick="window.location.href='/user/findConverseListPage?uid=${userBaseInfo.userid}'">通话记录</div>
                    </div>
                    <div class="table-box">
                        <table class="table table-bordered">
                            <tr>
                                <th>首次咨询时刻</th>
                                <th>末次咨询时刻</th>
                                <th>咨询总次数</th>
                                <th>有效咨询数</th>
                                <th>当前专属律师</th>
                            </tr>
                            <tr>
                                <td>${userBaseInfo.firstTime}</td>
                                <td>${userBaseInfo.lastTime}</td>
                                <td>${userBaseInfo.atimes}</td>
                                <td>${userBaseInfo.bak2}</td>
                                <td>
                                    <a href="/lawyer/findLawyerDetailInfo?lawyerid=${userBaseInfo.lawyerid}">
                                     ${userBaseInfo.lawyername}</a>
                                </td>
                            </tr>
                        </table>
                    </div>
                </div>
                <div class="table-util">
                    <div class="common-title">
                        <div class="common-left-line"></div>
                        <div class="common-text">管理备注</div>

                        <div class="common-right-btn edit-remark" name="roleMenu">修改</div>

                    </div>
                    <div class="remark" id="remark_div">
                        ${userBaseInfo.remark}
                    </div>
                </div>
            </div>
            <div class="cms-sub-right">
                <div class="common-title">
                    <div class="common-left-line"></div>
                    <div class="common-text">账户余额情况</div>
                </div>
                <div class="table-box">
                    <table class="table table-bordered">
                        <thead>  <tr>
                            <th>卡券名称</th>
                            <th>现金剩余</th>
                            <th>余量/总量</th>
                            <th>过期日期</th>
                        </tr>
                        </thead>
                        <tbody id="qbbody">

                        <tr>

                        </tr>
                        </tbody>
                    </table>
                </div>

                <div class="common-title">
                    <div class="common-left-line"></div>
                    <div class="common-text">公众号充值记录</div>
                </div>
                <div class="table-box">
                    <table class="table table-bordered">
                        <thead>  <tr>
                            <th>充值时间</th>
                            <th>充值金额</th>

                        </tr>
                        </thead>
                        <tbody id="paywxbody">

                        </tbody>

                    </table>
                </div>

                <div class="common-title">
                    <div class="common-left-line"></div>
                    <div class="common-text">公众号记录</div>
                </div>
                <div class="table-box">
                    <table class="table table-bordered">
                        <thead>  <tr>
                            <th>消费时间</th>
                            <th>消费金额</th>
                            <th>沟通律师</th>
                            <th>沟通时长</th>
                        </tr>
                        </thead>
                        <tbody id="wxbody">

                        </tbody>

                    </table>
                </div>

                <div class="common-title">
                    <div class="common-left-line"></div>
                    <div class="common-text">M站充值记录</div>
                </div>
                <div class="table-box">
                    <table class="table table-bordered">
                        <thead>  <tr>
                            <th>充值时间</th>
                            <th>充值金额</th>
                        </tr>
                        </thead>
                        <tbody id="paymzbody">

                        </tbody>

                    </table>
                </div>

                <div class="common-title">
                    <div class="common-left-line"></div>
                    <div class="common-text">M站消费记录</div>
                </div>
                <div class="table-box">
                    <table class="table table-bordered">
                        <thead>  <tr>
                            <th>消费时间</th>
                            <th>消费金额</th>
                            <th>沟通律师</th>
                            <th>沟通时长</th>
                        </tr>
                        </thead>
                        <tbody id="mbody">

                        </tbody>

                    </table>
                </div>
            </div>
        </div>
        <div class="bottom-btn">
            <div class="account-freeze" name="roleMenu">账户冻结</div>
            <div class="back-client-list"><a href="/user/userToSelect">返回客户列表</a></div>
        </div>
        <script id="paywxbodyscript" type="text/html">
        <!for(k in result){
        var v=result[k];
            !>
            <tr>
                <td><!=getFormatDate(v.czsj)!></td>
                <td><!=back_money_handler(v.czje/100)!></td>
            </tr>
            <!}!>
        </script>
        <script id="mbodyscript" type="text/html">
        <!for(k in result){
        var v=result[k];
            !>
            <tr>
                <td><!=getFormatDate(v.createTime)!></td>
                <td><!=back_money_handler(v.money/100)!></td>
                <td><!=v.lawyername!></td>
                <td><!=v.duration!></td>
            </tr>
            <!}!>
        </script>
        <script id="wxbodyscript" type="text/html">
        <!for(k in result){
        var v=result[k];
            !>
            <tr>
                <td><!=getFormatDate(v.createTime)!></td>
                <td><!=back_money_handler(v.money/100)!></td>
                <td><!=v.lawyername!></td>
                <td><!=v.duration!></td>
            </tr>
            <!}!>
        </script>
        <script id="paymzbodyscript" type="text/html">
        <!for(k in result){
        var v=result[k];
            !>
            <tr>
                <td><!=getFormatDate(v.czsj)!></td>
                <td><!=back_money_handler(v.czje/100)!></td>
            </tr>
            <!}!>
        </script>


    </div>
</div>

</div>
<div class="cms-modal-lg" id="remark">
    <div class="cms-modal-dialog">
        <div class="cms-modal-title">备注</div>
        <div class="cms-madal-content">
            <textarea placeholder="请输入备注" class="common-remark" id="note" maxlength="200"></textarea>
            <div class="limit200">限200字</div>
        </div>
        <div class="cms-modal-bottom clearfix">
            <button type="button" class="cms-confirm remark-confirm">确定</button>
            <button type="button" class="cms-cancel remark-cancel">取消</button>
        </div>
    </div>
</div>
<div class="cms-modal-ms" id="freeze-info">
    <div class="cms-modal-dialog">
        <div class="cms-modal-title">操作提醒</div>
        <div class="cms-madal-content">
            <div class="freeze-quesition"> 确认冻结该客户账户吗？</div>
            <div class="freeze-info">冻结后该客户将不能实现咨询、关注律师、更换专属律师、充值等行为。</div>
        </div>
        <div class="cms-modal-bottom">
            <button type="button" class="cms-confirm freeze-confirm">确定</button>
            <button type="button" class="cms-cancel freeze-cancel">取消</button>
        </div>
    </div>
</div>


</body>
<script type="text/javascript" src="/assets/js/lib/jquery-1.12.3.js"></script>
<script type="text/javascript" src="/assets/js/lib/bootstrap.min.js"></script>
<script type="text/javascript" src="/assets/js/lib/modal.js"></script>
<script type="text/javascript" src="/assets/js/lib/cmsmodal.js"></script>
<script type="text/javascript" src="/assets/js/lib/distpicker.data.js"></script>
<script type="text/javascript" src="/assets/js/lib/distpicker.js"></script>
<script type="text/javascript" src="/assets/js/lib/jquery.pagination.js"></script>

<script type="text/javascript" src="/assets/js/lib/My97DatePicker/WdatePicker.js"></script>


<script type="text/javascript" src="/assets/js/common.js"></script>
<script type="text/javascript" src="/assets/js/communal/template.js"></script>
<script type="text/javascript" src="/assets/js/client_detail.js"></script>
<script type="text/javascript">

var us=$("#ustates");
var  us_text=us["0"].innerText;
if(us_text=='1'){
    $("#ustates").html("正常");
    $('.account-freeze').html("账户冻结");
}else if(us_text=='2'){
    $("#ustates").html("冻结");
    $('.account-freeze').html("账户解冻");
}else{
    $("#ustates").html("未知");
}
</script>

</html>